#ifndef __H_GUID__
#define __H_GUID__

#include "tstring.h"
#pragma comment(lib, "Rpcrt4.lib")

namespace bl{


class Guid
{
public:
	Guid()
	{
		if(RPC_S_UUID_NO_ADDRESS == UuidCreateSequential(&guid_))
			UuidCreate(&guid_);
	}

	Guid(const tchar* guid)
	{
		UuidFromString((unsigned short*)(guid), &guid_);
	}

	tstring ToString()
	{
		tchar szBuf[MAX_PATH];
		StringFromGUID2(guid_, szBuf, MAX_PATH);
		return szBuf;
	}

private:
	Guid(const Guid&);
	Guid& operator=(const Guid&);

	UUID guid_;
};










}



#endif